import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import { AtList, AtAccordion, AtListItem, AtGrid, AtTabs, AtTabsPane } from 'taro-ui'
import './chakanbingli1.scss'
import { $navigateTo, $redirectTo, getGlobalData } from '../../../global';
import reactMixin from 'react-mixin';
import myJs from './chakanbingli1Js.js'
import app from '../../../main.js'

export default class Chakanbingli1 extends Component {
    config = {
        navigationBarTitleText: '查看病历'
    }
    constructor() {
        super(...arguments);
        this.state = this.getData();
    }
    handleClick8(value) {
        this.setState({
            current: value
        })
    }
    handleClick(value) {
        this.setState({
            open: value
        })
    }
    handleClick1(value) {
        this.setState({
            open1: value
        })
    }
    handleClick2(value) {
        this.setState({
            open2: value
        })
    }
    handleClick3(value) {
        this.setState({
            open3: value
        })
    }
    handleClick4(value) {
        this.setState({
            open4: value
        })
    }
    handleClick5(value) {
        this.setState({
            open5: value
        })
    }
    handleClick6(value) {
        this.setState({
            open6: value
        })
    }
    handleClick7(value) {
        this.setState({
            open7: value
        })
    }

    init() {
        this.setState({
            open:true,
            open1:true,
            open2:true,
            open3:true,
            open4:true,
            open5:true,
            open6:true,
            open7:true,
            
          });
    }
    //栅格的跳转
    go = (item, index) => {
        switch (index) {
            case 0: app.redirectTo('../../patientlables/pages/cooperations/cooperations');
                break;
            case 1: app.redirectTo('../suifangjihua/suifangjihua?page=chakanbingli');
                break;
            case 2: app.redirectTo('../zhuanzhenHuanZhe/zhuanzhenHuanZhe');
                break;
            case 4: app.redirectTo('../tianjiabingli1/tianjiabingli1')
        }
    }

    render() {
        const tabList = [{ title: '左眼' }, { title: '右眼' }]
        return (
            <View className='chakanbingli1'>
                <AtList className=' class_0'>
                    <Text className=' class_1'>就诊日期：{this.state.case_detail.visit_at}</Text>
                    <Image className=' class_2' src={getGlobalData('baseurl') + 'img/rili.png'}></Image>
                </AtList>
                <AtList className=' class_3'></AtList>
                <AtList className=' class_4'>
                    <AtAccordion title='患者资料'
                        open={this.state.open}
                        onClick={this.handleClick.bind(this)}
                    >
                        <AtListItem title='姓名' extraText={this.state.case_detail.patient_name} className=' class_14'></AtListItem>
                        <AtListItem title='性别' extraText={this.state.case_detail.gender} className=' class_14'></AtListItem>
                        <AtListItem title='出生日期' extraText={this.state.case_detail.birthday} className=' class_14'></AtListItem>
                        <AtListItem title='手机号' extraText={this.state.case_detail.phone} className=' class_14'></AtListItem>
                        <AtListItem title='职业' extraText={this.state.case_detail.occupation} className=' class_14'></AtListItem>
                        <AtListItem title='居住地' extraText={this.state.case_detail.province + this.state.case_detail.city} className=' class_14'></AtListItem>
                        <AtListItem title='婚姻' extraText={this.state.case_detail.marry_status} className=' class_14'></AtListItem>
                    </AtAccordion>
                </AtList>
                <AtGrid onClick={this.go} mode='rect' data={[{ image: getGlobalData('baseurl') + 'img/tuandui.png', value: '团队协作' }, { image: getGlobalData('baseurl') + 'img/faqisuifang.png', value: '发起随访' }, { image: getGlobalData('baseurl') + 'img/zhuanzhen.png', value: '转诊患者' }, { image: getGlobalData('baseurl') + 'img/fenxiang.png', value: '分享病历' }, { image: getGlobalData('baseurl') + 'img/bianji.png', value: '编辑病历' }]} className=' class_5'>
                </AtGrid>
                <AtList className=' class_6'>
                    <AtAccordion title='主诉'
                        open={this.state.open1}
                        onClick={this.handleClick1.bind(this)}
                    >
                        <View className=' class_7'>
                            <Text className=' class_8'>{this.state.case_detail.main_suit}</Text>
                        </View>
                    </AtAccordion>
                </AtList>
                <AtList className=' class_9'>
                    <AtAccordion title='现病史'
                        open={this.state.open2}
                        onClick={this.handleClick2.bind(this)}
                    >
                        <View className=' class_10'>
                            <Text className=' class_11'>{this.state.case_detail.present_illness}
                            </Text>
                        </View>
                    </AtAccordion>
                </AtList>
                <AtList className=' class_13'>
                    <AtAccordion title='既往史'
                        open={this.state.open3}
                        onClick={this.handleClick3.bind(this)}
                    >
                        <AtListItem title='慢性病史' extraText={this.state.case_detail.manxingbingshi} className=' class_14'></AtListItem>
                        <AtListItem title='眼外伤史' extraText={this.state.case_detail.yanwaishangshi} className=' class_15'></AtListItem>
                        <AtListItem title='屈光状态' extraText={this.state.case_detail.quguangzhuangtai} className=' class_16'></AtListItem>
                        <AtListItem title='眼部手术史' extraText={this.state.case_detail.yanbusoushushi} className=' class_17'></AtListItem>
                        <AtListItem title='眼病史' extraText={this.state.case_detail.yanbingshi} className=' class_18'></AtListItem>
                        <AtListItem title='传染病史' extraText={this.state.case_detail.chuanranbingshi} className=' class_19'></AtListItem>
                        <AtListItem title='过敏史' extraText={this.state.case_detail.guominshi} className=' class_20'>
                            <AtList className=' class_21'></AtList>
                        </AtListItem>
                    </AtAccordion>
                </AtList>
                <AtList className=' class_22'>
                    <AtListItem title='家族史' extraText={this.state.case_detail.family_illness}>
                        <AtList className=' class_23'></AtList>
                    </AtListItem>
                </AtList>
                <AtList className=' class_24'>
                    <AtAccordion title='诊断'
                        open={this.state.open4}
                        onClick={this.handleClick4.bind(this)}
                    >
                        <View className=' class_25'>
                            <Text className=' class_26'>{this.state.case_detail.zhenduan}
                                <AtList className=' class_27'></AtList>
                            </Text>
                        </View>
                    </AtAccordion>
                </AtList>
                <AtList className=' class_28'>
                    <AtListItem title='治疗' extraText={this.state.case_detail.zhiliao}>
                        <AtList className=' class_29'></AtList>
                    </AtListItem>
                </AtList>
                <AtList className=' class_30'>
                    <AtAccordion title='体格检查'
                        open={this.state.open5}
                        onClick={this.handleClick5.bind(this)}
                    >
                        <AtList>
                            <AtListItem title='体温' extraText={this.state.case_detail.tiwen} className=' class_14'></AtListItem>
                            <AtListItem title='呼吸' extraText={this.state.case_detail.huxi} className=' class_14'></AtListItem>
                            <AtListItem title='脉搏' extraText={this.state.case_detail.maibo} className=' class_14'></AtListItem>
                            <AtListItem title='血压' extraText={this.state.case_detail.xueya_shousuo+this.state.case_detail.xueya_shuzhang} className=' class_14'></AtListItem>
                            <AtListItem title='体重' extraText={this.state.case_detail.tizhong} className=' class_14'></AtListItem>
                        </AtList>
                    </AtAccordion>
                </AtList>
                <AtList className=' class_31'>
                    <AtAccordion title='眼科检查'
                        open={this.state.open6}
                        onClick={this.handleClick6.bind(this)}
                    >
                        <AtTabs current={this.state.current} tabList={tabList} onClick={this.handleClick8.bind(this)}>
                            <AtTabsPane current={this.state.current} index={0} >
                                <View >
                                    <AtListItem title='裸眼视力' extraText={this.state.left_eye.luoyanshili} className=' class_14'></AtListItem>
                                    <AtAccordion title='矫正' open={true} className=' class_14'>
                                        <AtListItem title='DS' extraText={this.state.left_eye.jiaozhengshili.ds} className=' class_33'></AtListItem>
                                        <AtListItem title='DC' extraText={this.state.left_eye.jiaozhengshili.dcx} className=' class_34'></AtListItem>
                                        <AtListItem title='度数' extraText={this.state.left_eye.jiaozhengshili.zhouwei} className=' class_35'></AtListItem>
                                        <AtListItem title='→' extraText={this.state.left_eye.jiaozhengshili.jiaozheng} className=' class_36'></AtListItem>
                                    </AtAccordion>
                                    <AtListItem title='光定位' extraText={this.state.left_eye.guangdingwei} className=' class_37'></AtListItem>
                                    <AtListItem title='色觉' extraText={this.state.left_eye.sejue} className=' class_38'></AtListItem>
                                    <AtListItem title='眼睑' extraText={this.state.left_eye.yanjian} className=' class_39'></AtListItem>
                                    <AtListItem title='眼位' extraText={this.state.left_eye.yanwei} className=' class_40'></AtListItem>
                                    <AtListItem title='眼球' extraText={this.state.left_eye.yanqiu} className=' class_41'></AtListItem>
                                    <AtListItem title='睫毛' extraText={this.state.left_eye.jiemao} className=' class_42'></AtListItem>
                                    <AtListItem title='结膜' extraText={this.state.left_eye.jiemo} className=' class_43'></AtListItem>
                                    <AtListItem title='胬肉' extraText={this.state.left_eye.nurou} className=' class_44'></AtListItem>
                                    <AtListItem title='泪道冲洗' extraText={this.state.left_eye.leidaochongxi} className=' class_45'></AtListItem>
                                    <AtListItem title='角膜' extraText={this.state.left_eye.jiaomo} className=' class_46'></AtListItem>
                                    <AtListItem title='虹膜' extraText={this.state.left_eye.hongmo} className=' class_47'></AtListItem>
                                    <AtListItem title='瞳孔' extraText={this.state.left_eye.tongkong} className=' class_48'></AtListItem>
                                    <AtListItem title='晶状体' extraText={this.state.left_eye.jingzhuangti} className=' class_49'></AtListItem>
                                    <AtListItem title='玻璃体' extraText={this.state.left_eye.boliti} className=' class_50'></AtListItem>
                                    <AtListItem title='眼底' extraText={this.state.left_eye.yandi} className=' class_51'></AtListItem>
                                    <AtAccordion title='前房' open={true} className=' class_14'>
                                        <AtListItem title='轴深' extraText={this.state.left_eye.qianfang.axis_depth} className=' class_52'></AtListItem>
                                        <AtListItem title='周深' extraText={this.state.left_eye.qianfang.week_depth} className=' class_53'></AtListItem>
                                    </AtAccordion>
                                    <AtListItem title='眼压' extraText={this.state.left_eye.yanya} className=' class_54'></AtListItem>
                                    {/* <AtListItem title='角膜厚度' extraText='39' className=' class_55'></AtListItem>
                                    <AtAccordion title='角膜曲率' open={true} className=' class_14'>
                                        <AtListItem title='K1' extraText='39' className=' class_56'></AtListItem>
                                        <AtListItem title='K2' extraText='39' className=' class_57'></AtListItem>
                                        <AtListItem title='K3' extraText='39' className=' class_58'></AtListItem>
                                        <AtListItem title='K4' extraText='39' className=' class_59'></AtListItem>
                                    </AtAccordion> */}
                                    <AtListItem title='AB超' extraText={this.state.left_eye.abchao} className=' class_60'></AtListItem>
                                    {/* <AtListItem title='B超' extraText='清晰' className=' class_61'></AtListItem> */}
                                    <AtListItem title='内皮细胞数' extraText={this.state.left_eye.neipixibao} className=' class_62'></AtListItem>
                                    <AtListItem title='光焦度' extraText={this.state.left_eye.guangjiaodu} className=' class_63'></AtListItem>
                                    <AtListItem title='拱高' extraText={this.state.left_eye.gonggao} className=' class_64'></AtListItem>
                                    </View>
                            </AtTabsPane>
                            <AtTabsPane current={this.state.current} index={1}>
                            <View >
                                    <AtListItem title='裸眼视力' extraText={this.state.right_eye.luoyanshili} className=' class_14'></AtListItem>
                                    <AtAccordion title='矫正' open={true} className=' class_14'>
                                        <AtListItem title='DS' extraText={this.state.right_eye.jiaozhengshili.ds} className=' class_33'></AtListItem>
                                        <AtListItem title='DC' extraText={this.state.right_eye.jiaozhengshili.dcx} className=' class_34'></AtListItem>
                                        <AtListItem title='度数' extraText={this.state.right_eye.jiaozhengshili.zhouwei} className=' class_35'></AtListItem>
                                        <AtListItem title='→' extraText={this.state.right_eye.jiaozhengshili.jiaozheng} className=' class_36'></AtListItem>
                                    </AtAccordion>
                                    <AtListItem title='光定位' extraText={this.state.right_eye.guangdingwei} className=' class_37'></AtListItem>
                                    <AtListItem title='色觉' extraText={this.state.right_eye.sejue} className=' class_38'></AtListItem>
                                    <AtListItem title='眼睑' extraText={this.state.right_eye.yanjian} className=' class_39'></AtListItem>
                                    <AtListItem title='眼位' extraText={this.state.right_eye.yanwei} className=' class_40'></AtListItem>
                                    <AtListItem title='眼球' extraText={this.state.right_eye.yanqiu} className=' class_41'></AtListItem>
                                    <AtListItem title='睫毛' extraText={this.state.right_eye.jiemao} className=' class_42'></AtListItem>
                                    <AtListItem title='结膜' extraText={this.state.right_eye.jiemo} className=' class_43'></AtListItem>
                                    <AtListItem title='胬肉' extraText={this.state.right_eye.nurou} className=' class_44'></AtListItem>
                                    <AtListItem title='泪道冲洗' extraText={this.state.right_eye.leidaochongxi} className=' class_45'></AtListItem>
                                    <AtListItem title='角膜' extraText={this.state.right_eye.jiaomo} className=' class_46'></AtListItem>
                                    <AtListItem title='虹膜' extraText={this.state.right_eye.hongmo} className=' class_47'></AtListItem>
                                    <AtListItem title='瞳孔' extraText={this.state.right_eye.tongkong} className=' class_48'></AtListItem>
                                    <AtListItem title='晶状体' extraText={this.state.right_eye.jingzhuangti} className=' class_49'></AtListItem>
                                    <AtListItem title='玻璃体' extraText={this.state.right_eye.boliti} className=' class_50'></AtListItem>
                                    <AtListItem title='眼底' extraText={this.state.right_eye.yandi} className=' class_51'></AtListItem>
                                    <AtAccordion title='前房' open={true} className=' class_14'>
                                        <AtListItem title='轴深' extraText={this.state.right_eye.qianfang.axis_depth} className=' class_52'></AtListItem>
                                        <AtListItem title='周深' extraText={this.state.right_eye.qianfang.week_depth} className=' class_53'></AtListItem>
                                    </AtAccordion>
                                    <AtListItem title='眼压' extraText={this.state.right_eye.yanya} className=' class_54'></AtListItem>
                                    {/* <AtListItem title='角膜厚度' extraText='39' className=' class_55'></AtListItem>
                                    <AtAccordion title='角膜曲率' open={true} className=' class_14'>
                                        <AtListItem title='K1' extraText='39' className=' class_56'></AtListItem>
                                        <AtListItem title='K2' extraText='39' className=' class_57'></AtListItem>
                                        <AtListItem title='K3' extraText='39' className=' class_58'></AtListItem>
                                        <AtListItem title='K4' extraText='39' className=' class_59'></AtListItem>
                                    </AtAccordion> */}
                                    <AtListItem title='AB超' extraText={this.state.right_eye.abchao} className=' class_60'></AtListItem>
                                    {/* <AtListItem title='B超' extraText='清晰' className=' class_61'></AtListItem> */}
                                    <AtListItem title='内皮细胞数' extraText={this.state.right_eye.neipixibao} className=' class_62'></AtListItem>
                                    <AtListItem title='光焦度' extraText={this.state.right_eye.guangjiaodu} className=' class_63'></AtListItem>
                                    <AtListItem title='拱高' extraText={this.state.right_eye.gonggao} className=' class_64'></AtListItem>
                                    </View>
                            </AtTabsPane>
                        </AtTabs>


                    </AtAccordion>
                </AtList>
                <AtList className=' class_65'>
                    <AtAccordion title='拍摄检查报告'
                        open={this.state.open7}
                        onClick={this.handleClick7.bind(this)}
                    >{this.state.case_detail.report_images}</AtAccordion>
                </AtList>
            </View>
        );
    }
}
reactMixin.onClass(Chakanbingli1, myJs);